<?php declare(strict_types=1);

namespace think\msg\msg;

use think\msg\BuilderTrait;

/**
 * 纯文本模板
 */
class TextMsg implements Msg
{
    use BuilderTrait;

    /**
     * @var string 接收者用户ID/用户名/手机号
     */
    private $toUser;

    /**
     * @var string 消息内容
     */
    private $content;

    public function setContent(string $content): self
    {
        $this->content = $content;
        return $this;
    }

    public function getContent(): string
    {
        return $this->content;
    }

    public function getToUser(): string
    {
        return $this->toUser;
    }

    public function setToUser(string $toUser): void
    {
        $this->toUser = $toUser;
    }

    public function jsonSerialize(): string
    {
        return serialize($this);
    }
}
